package com.hxzy.mapper;

import com.hxzy.controller.admin.dictdata.req.DictDataReq;
import com.hxzy.entity.SysDictData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
* @author Administrator
* @description 针对表【sys_dict_data(字典数据表)】的数据库操作Mapper
* @createDate 2023-06-28 16:38:45
* @Entity com.hxzy.entity.SysDictData
*/
public interface SysDictDataMapper extends BaseMapper<SysDictData> {

    /**
     * 查询
     * @param req
     * @return
     */
    List<SysDictData> search(@Param(value = "req") DictDataReq req);

    @Update(value = "update sys_dict_data set dict_type=#{newValue} where dict_type=#{oldValue}")
    int updateDictType(@Param(value = "oldValue") String oldValue, @Param(value = "newValue")String newValue);

    /**
     * 查询所有未被禁用的状态
     * @return
     */
    List<SysDictData> searchAllData();
}




